//
// CTextureUser.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CRGBA;

public class CTextureUser {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CTextureUser(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CTextureUser obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CTextureUser(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CTextureUser() {
    this(nel3dJNI.new_CTextureUser__SWIG_0(), true);
  }

  public CTextureUser(ITexture text) {
    this(nel3dJNI.new_CTextureUser__SWIG_1(ITexture.getCPtr(text), text), true);
  }

  public void setWrapS(SWIGTYPE_p_TWrapMode mode) {
    nel3dJNI.CTextureUser_setWrapS(swigCPtr, this, SWIGTYPE_p_TWrapMode.getCPtr(mode));
  }

  public void setWrapT(SWIGTYPE_p_TWrapMode mode) {
    nel3dJNI.CTextureUser_setWrapT(swigCPtr, this, SWIGTYPE_p_TWrapMode.getCPtr(mode));
  }

  public SWIGTYPE_p_TWrapMode getWrapS() {
    return new SWIGTYPE_p_TWrapMode(nel3dJNI.CTextureUser_getWrapS(swigCPtr, this), true);
  }

  public SWIGTYPE_p_TWrapMode getWrapT() {
    return new SWIGTYPE_p_TWrapMode(nel3dJNI.CTextureUser_getWrapT(swigCPtr, this), true);
  }

  public void setUploadFormat(SWIGTYPE_p_TUploadFormat pf) {
    nel3dJNI.CTextureUser_setUploadFormat(swigCPtr, this, SWIGTYPE_p_TUploadFormat.getCPtr(pf));
  }

  public SWIGTYPE_p_TUploadFormat getUploadFormat() {
    return new SWIGTYPE_p_TUploadFormat(nel3dJNI.CTextureUser_getUploadFormat(swigCPtr, this), true);
  }

  public void setFilterMode(SWIGTYPE_p_TMagFilter magf, SWIGTYPE_p_TMinFilter minf) {
    nel3dJNI.CTextureUser_setFilterMode(swigCPtr, this, SWIGTYPE_p_TMagFilter.getCPtr(magf), SWIGTYPE_p_TMinFilter.getCPtr(minf));
  }

  public SWIGTYPE_p_TMagFilter getMagFilter() {
    return new SWIGTYPE_p_TMagFilter(nel3dJNI.CTextureUser_getMagFilter(swigCPtr, this), true);
  }

  public SWIGTYPE_p_TMinFilter getMinFilter() {
    return new SWIGTYPE_p_TMinFilter(nel3dJNI.CTextureUser_getMinFilter(swigCPtr, this), true);
  }

  public boolean mipMapOff() {
    return nel3dJNI.CTextureUser_mipMapOff(swigCPtr, this);
  }

  public boolean mipMapOn() {
    return nel3dJNI.CTextureUser_mipMapOn(swigCPtr, this);
  }

  public CRGBA getPixelColor(int x, int y) {
    return new CRGBA(nel3dJNI.CTextureUser_getPixelColor(swigCPtr, this, x, y), true);
  }

  public void setReleasable(boolean bReleasable) {
    nel3dJNI.CTextureUser_setReleasable(swigCPtr, this, bReleasable);
  }

  public ITexture getITexture() {
    long cPtr = nel3dJNI.CTextureUser_getITexture(swigCPtr, this);
    return (cPtr == 0) ? null : new ITexture(cPtr, false);
  }

  public SWIGTYPE_p_NLMISC__CBitmap generateDatas() {
    long cPtr = nel3dJNI.CTextureUser_generateDatas(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_NLMISC__CBitmap(cPtr, false);
  }

  public void releaseDatas() {
    nel3dJNI.CTextureUser_releaseDatas(swigCPtr, this);
  }

}
